import java.util.Arrays;

public class Solution1760 {
    public int minimumSize(int[] nums, int maxOperations) {
        int l=1,r= Arrays.stream(nums).max().getAsInt(),ans=-1;
        while (l<=r){
            int mid=(l+r)/2;
            int count=0;
            for (int num : nums) {
                count+=(num-1)/mid;
            }
            if (count<=maxOperations){
                ans=mid;
                r=mid-1;
            }else {
                l=mid+1;
            }
        }
        return ans;
    }

    public static void main(String[] args) {
        System.out.println(new Solution1760().minimumSize(new int[]{9},2));
    }
}
